/**
 * 
 */
package com.yidin.lsc;

import java.util.HashMap;
import java.util.List;

import com.yidin.entry.NearByStoreEntry;
import com.yidin.entry.PhotoListEntry;
import com.yidin.entry.UserLoadCommentListEntry;
import com.yidin.util.NetImageBase;
import com.yidin.util.imageCallback;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

/**
 * 适配器基类
 * 
 * @author cola
 * 
 */
public class MyBaseAdapter<T> extends BaseAdapter  {
	protected Context context;
	protected static HashMap<Integer, Bitmap> isSelected;

	public MyBaseAdapter(List<T> info,Context context) {
		this.context = context;
		isSelected = new HashMap<Integer, Bitmap>();
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * 显示图片
	 */
	public Handler handler = new Handler() {
		public void handleMessage(Message msg) {
			switch (msg.what) {
			case 5: {
				NetImageBase item = (NetImageBase) msg.obj;

				Bitmap bm = item.getLocalBitmap(null, context, item.path, 80,
						80);
				item.ic.getImage(bm);
				break;
			}
			case 4: {
				NetImageBase item = (NetImageBase) msg.obj;

				Bitmap bm = item.getLocalBitmap(null, context, item.path, 80,
						80);
				item.ic.getImage(BitmapFactory.decodeResource(
						context.getResources(), R.drawable.dt_tx));
				break;
			}
			}
		}
	};

	public static HashMap<Integer, Bitmap> getIsSelected() {
		return isSelected;
	}

	private imageCallback imageback;
}
